import lejos.nxt.Button;
import lejos.nxt.LCD;
import lejos.nxt.LightSensor;
import lejos.nxt.Motor;
import lejos.nxt.SensorPort;
import lejos.nxt.addon.CompassSensor;
import lejos.nxt.comm.RConsole;
import lejos.robotics.navigation.CompassPilot;
import lejos.robotics.navigation.Pilot;

public class LightSensorTest {

	/**
	 * Turns on left and right sensors,
	 * then takes 100 readings at half-second intervals.
	 * @param args
	 */
	public static void main(String[] args) {
		LCD.drawString("Press a button...", 0, 0);
		Button.waitForPress();
		LightSensor leftLightSensor, rightLightSensor;
		
		leftLightSensor = new LightSensor(SensorPort.S1, false);
		rightLightSensor = new LightSensor(SensorPort.S4, false);

		leftLightSensor.setFloodlight(true);
		LCD.drawString("Left On!", 0, 0);
		Button.waitForPress();
		rightLightSensor.setFloodlight(true);
		LCD.drawString("Right On!", 0, 0);
		Button.waitForPress();

		for (int i = 0; i < 100; i++) {
			System.out.println("L: " + leftLightSensor.getLightValue() + ", R: " + rightLightSensor.getLightValue());
			Button.waitForPress(500);
		}
	}
}
